<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@page import="br.com.bean.EnsinoBean"%>
<%@page import="br.com.bean.TurnoBean"%>
<%@page import="br.com.bean.BimestreBean"%>
<%@page import="br.com.controller.TurnoController"%>
<%@page import="br.com.controller.EnsinoController"%>
<%@page import="br.com.controller.BimestreController"%>
<%@page import="br.com.connection.ConnectionFactory"%>
<%@page import="java.sql.Connection"%>
<%@page import="java.util.List"%>
<%@page import="java.util.Date"%>
<%@page import="java.text.SimpleDateFormat"%>

<%Connection conn = new ConnectionFactory().getConnection();%>

 <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Matricula</title>

<!-- Css -->
<link rel="stylesheet" type="text/css" href="Css/css.css" />
<link rel="stylesheet" type="text/css" href="Css/style.css" />

<!-- Script -->
<script type='text/javascript' src='Script/ajax.js'></script>
<script type='text/javascript' src='Jquery/jquery.autocomplete.js' charset="utf-8"></script>
<script type='text/javascript' src='Script/mascaras.js' charset="utf-8"></script>


<script>
	jQuery(function(){
		$("#aluno").autocomplete("list.jsp", {  
            maxHeight: 10,  
            width: 200,  
            selectFirst: true
        });  
});  
</script>

</head>

<body>


	<div id="html">

		<form method="post" action="CadMatriculaServlet">
			<h2>Cadastro de Matricula</h2>
			<table>
				<tr>
					<th>Aluno:</th>
					<td><input type="text" name="aluno" onKeyup="upMe(this);" id="aluno" maxlength="150" 
					onBlur="MandaID(this.value, 'infoAlunoMatri.jsp', 'info')"/>
					</td>
				</tr>
			</table>

			<div id="info"></div>

			<table>
				<tr>
					<th>Nº Chamada:</th>
					<td><input type="text" name="nchamada" id="nchamada"
						maxlength="10" />
					</td>
				</tr>
				<tr>
					<th>Ano letivo:</th>
					<td><input type="text" name="anoletivo" id="anoletivo"
						maxlength="4" />
					</td>
				</tr>
				<tr>
					<th>Tipo de Matricula:</th>
					<td><select name="tipomatricula">
							<option value="0">Selecione</option>
							<option value="MI">Inicial</option>
							<option value="TR">Transferido</option>
					</select>
					</td>
				</tr>
				<tr>
					<th>Turno:</th>
					<td><select name="turno" onchange="MandaID(this.value, 'ensino.jsp', 'ensino');">
							<option value="0">Selecione</option>
							<%List<TurnoBean> turno = TurnoController.ListTurno(conn);
							for(TurnoBean t : turno){
							%>
							<option value="<%=t.getId()%>"><%=t.getDescricao()%></option>
							<%
								}
							%>
					</select>
					</td>
				</tr>
				<tr>
					<th>Ensino:</th>
					<td><select name="ensino" id="ensino" onchange="MandaID(this.value, 'serie.jsp', 'serie');">
					<option value="0">Selecione</option>		
					</select></td>
				</tr>
				<tr>
					<th>Serie:</th>
					<td><select name="serie" id="serie" onchange="MandaID(this.value, 'turma.jsp', 'turma')">
							<option value="0">Selecione</option>
					</select>
					</td>
				</tr>
				<tr>
					<th>Turma:</th>
					<td><select name="turma" id="turma">
							<option value="0">Selecione</option>
					</select>
					</td>
				</tr>
				<tr>
					<th>Observação</th>
					<td><input type="text" name="observacao" id="observacao"
					 maxlength="150" />
					</td>
				</tr>
				<tr>
					<th>Data Matricula:</th>
					<td><input type="text" name="datamatri" id="data" /><span class=laranja> * </span>
					</td>
				</tr>
			</table>

			<input type="submit" name="finalizar" id="finalizar" value="Finalizar" />
			<input type="reset" name="cancelar" id="cancelar" value="Cancelar" />

		</form>
	</div>
<body>
</html>